#ifndef TIMER_H
#define TIMER_H


typedef enum{
	ID_TIMER1=1,
	ID_TIMER2,
	ID_TIMER3,
	ID_TIMER4,
	ID_TIMER5,
	ID_TIMER6,
}TimerID;
typedef void (*timer_callback)(TimerID id, void* arg);

typedef void (*timer_callback)(TimerID id, void* arg);

typedef struct{
	u32 timeout_cnt;
	timer_callback callback;
	void* arg;
}TimerCfg;

struct TimerDevice{
	char name[16];
	u8   id;
	BOOL (*start)(struct TimerDevice* dev, u32 timeout_us);
	void (*stop)(struct TimerDevice* dev);
	TimerCfg cfg;
};



struct TimerDevice* 	 request_timer(void);
void set_timeout_param(struct TimerDevice* timer,timer_callback timeout_cb,void* arg);
BOOL start_timer(struct TimerDevice* timer,u32 timeout_us);
void stop_timer(struct TimerDevice* timer);
BOOL register_timer_device(struct TimerDevice* dev);
u8   get_timer_number(void);
void raise_timeout(struct TimerDevice* dev);
#endif
